import request from '@/utils/request';

export function getGeeTestCode() {
    return request({
        url: '/v1/tools/geetest/code',
        method: 'get'
    });
}

export function login(username, password) {
    return request({
        url: '/v1/user/login',
        method: 'post',
        data: {
            userName: username,
            password
        }
    });
}

export function logout() {
    return request({
        url: '/v1/user/logout',
        method: 'get'
    });
}

export function updatePassword({ orgPassword, password, rePassword }) {
    return request({
        url: '/v1/user/changePwd',
        method: 'post',
        data: {
            orgPassword,
            password,
            rePassword
        }
    });
}
